const { ipcRenderer, contextBridge } = require('electron')

contextBridge.exposeInMainWorld("xapi", {
    getDeviceIds: () => ipcRenderer.invoke('on-get-devices'),
    getTopPackageName: (snArray) => ipcRenderer.invoke('on-get-package-name', snArray),
    getWholeActivity: (sn, packageName) => ipcRenderer.invoke('on-get-whole-activity', sn, packageName),
    adbAppStart: (snArray, wholeActivitys) => ipcRenderer.invoke('on-start-app', snArray, wholeActivitys),
    onStartResultBack: (callback) => ipcRenderer.on('adb-app-start-result', (event, result) => callback(result)),
    onStartLogBack: (callback) => ipcRenderer.on('adb-app-start-log', (event, log) => callback(log)),
})
